<template>
  <div id="main-root">
      <div id="nav">
        <router-link to="/">Home</router-link> |
        <router-link to="/about">About</router-link> |
        <router-link to="/project-a">去应用A首页</router-link> |
        <router-link to="/project-a/a">去应用A二级路由</router-link> |
        <router-link to="/project-b">去应用B(非webpack构建应用,即官网说的的pureHtml)</router-link>
      </div>
      <div>今年目标：{{val}} 亿</div>
      <router-view/>
      <div id="micro-app"></div>
  </div>
</template>

<script>
export default {
  name: 'App',
  props: {
    loading: Boolean,
    content: String
  },
  data() {
    return {
      val: 0
    }

  },
  mounted() {
    this.$nextTick(() => {
      this.$actions.onGlobalStateChange(({inputVal}) => {
        this.val = inputVal
      })
    })

  }
}
</script>
<style>
#main-root {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;
}

#nav a {
  font-weight: bold;
  color: #2c3e50;
}

#nav a.router-link-exact-active {
  color: #42b983;
}
</style>
